#!/bin/bash

export CC="ccache /opt/local/bin/gcc-mp-4.7"
export CXX="ccache /opt/local/bin/g++-mp-4.7"
export CPP="/opt/local/bin/cpp-mp-4.7"
export CFLAGS="${BUILD32:=-arch i386 -m32} -O3 -mtune=native -fopenmp"
export CXXFLAGS="$CFLAGS -D_DARWIN_NO_64_BIT_INODE"
export CPPFLAGS="-I/opt/local/include"
export LDFLAGS="$BUILD32 -framework CoreServices -lz -lGL -lGLU -L/opt/local/lib"
export LIBS="-lGL -lGLU"

./configure \
    --prefix=/usr/local/wine \
    --build=x86_64-apple-darwin10.8.0 \
    --with-x \
    --x-include=/opt/local/include \
    --x-lib=/opt/local/lib \
    --disable-tests \
    --disable-win16 \
    --with-coreaudio \
    --with-opengl \
    --without-mpg123

make -j4 install
